package org.huawei260.TiKu.ODsuanfa;

import java.util.Arrays;
import java.util.Scanner;
public class A_2023A_3252__固定滑窗_知识图谱新词挖掘 {

//	public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);

			String content = sc.next();
			String word = sc.next();

			System.out.println(getResult(content, word));
		}

		public static int getResult(String content, String word) {
			if (content.length() < word.length()) return 0;

			char[] tmp = word.toCharArray();
			Arrays.sort(tmp);
			String sorted_word = new String(tmp);

			int ans = 0;
			int maxI = content.length() - word.length();
			int len = word.length();

			for (int i = 0; i <= maxI; i++) {
				char[] window = content.substring(i, i + len).toCharArray();
				Arrays.sort(window);

				if (sorted_word.equals(new String(window))) {
					ans++;
				}
			}

			return ans;
		}
	}